home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / lblcs.arc / CRT_MODE.ASM < prev    next >
Assembly Source File  |  1985-04-04  |  2KB  |  112 lines

  1.  
  2. ;-----------------------------------------------------------------------
  3. ;
  4. ; name        crt_setmode -- set screen mode
  5. ;
  6. ; synopsis    VOID    crt_setmode(mode)
  7. ;            int    mode;
  8. ;
  9. ; description      Set screen to graphics or text mode.
  10. ;
  11. ;
  12. ;        TEXT MODES
  13. ;        ----------
  14. ;        0    =    40 x 25  monochrome
  15. ;        1    =    40 x 25  color        
  16. ;        2    =    80 x 25  monochrome    
  17. ;        3    =    80 x 25  color        
  18. ;
  19. ;        GRAPHICS MODES
  20. ;        --------------
  21. ;        4    =    320 x 200 color        
  22. ;        5    =    320 x 200 monochrome    
  23. ;        6    =    640 x 400 monochrome    
  24. ;        7    =    unknown
  25. ;
  26. ;        OTHER MODES    (some require HI-RES board)
  27. ;        -----------
  28. ;        8    =    640 x 400 color        
  29. ;        9    =    640 x 400 monochrome    
  30. ;                10    =    160 x 200 color (16 colors)
  31. ;
  32. ;------------------------------------------------------------------
  33.  
  34. ;-----------------------------------------------------------------------
  35. ;
  36. ; name        crt_getmode -- get current video mode
  37. ;
  38. ; synopsis    int    crt_getmode()
  39. ;
  40. ; description    Returns current value of mode setting.
  41. ;        See set_mode for further info about modes.
  42. ;
  43. ;-----------------------------------------------------------------------
  44.  
  45.  
  46.     include    dos.mac
  47.  
  48. video    equ    10h        ; video interrupt number
  49.  
  50.  
  51.     IF    LPROG
  52. X    EQU    6        ;OFFSET OF ARGUMENTS
  53.     ELSE
  54. X    EQU    4        ;OFFSET OF ARGUMENTS
  55.     ENDIF
  56.  
  57.     PSEG
  58.  
  59.  
  60.     PAGE    60,132
  61.  
  62.     PUBLIC    crt_setmode
  63.  
  64.     IF    LPROG
  65. crt_setmode    PROC    FAR
  66.     ELSE
  67. crt_setmode    PROC    NEAR
  68.     ENDIF
  69.  
  70.  
  71.     PUSH    BP            ;SAVE BP
  72.     MOV    BP,SP
  73.  
  74.     mov    al,[bp+x]        ; get mode to set
  75.     xor    ah,ah            ; reset display adaptor function
  76.     int    video
  77.  
  78.     POP    BP
  79.     RET
  80. crt_setmode    ENDP
  81.  
  82.     page    60,132
  83.  
  84.  
  85.     PUBLIC    crt_getmode
  86.  
  87.     IF    LPROG
  88. crt_getmode    PROC    FAR
  89.     ELSE
  90. crt_getmode    PROC    NEAR
  91.     ENDIF
  92.  
  93.  
  94.     mov    ah,15        ; get current CRT mode function
  95.     int    video
  96.     xor    ah,ah        ; make full word in ax
  97.     ret
  98.  
  99. crt_getmode    ENDP
  100.  
  101.  
  102.  
  103.  
  104. ;=======================================================================
  105.  
  106.  
  107.  
  108.     ENDPS    
  109.     END
  110.  
  111.